package com.xiang.publicdemo.module2.controller;

import com.xiang.publicdemo.module2.service.ITestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@Slf4j
@RequestMapping("/test")
public class TestController {

    @Autowired
    private ITestService testService;

    @GetMapping("/test")
    @ResponseBody
    public String async(HttpSession session) {
        log.debug("sessionId:{}", session.getId());
        testService.test("aa");
        return "test";
    }
}
